<form class="default" action="" method="post" enctype="multipart/form-data">
	<fieldset>
		<legend>Содержание страницы</legend>
		<div class="row">
			<div class="label">Текст страницы</div>
			<div class="field"><textarea name="wallpapers[text]"><?php echo $info->text; ?></textarea></div>
		</div>
		<div class="row">
			<input type="submit" value="Сохранить" />
		</div>
	</fieldset>
</form>

<table class="default">
	<thead>
		<tr>
			<?php foreach ($columns as $column => $data): ?>
				<td><?php echo $column; ?></td>
			<?php endforeach; ?>
			<td></td><td></td>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($wallpapers as $wallpaper): ?>
		<tr>
			<?php foreach ($columns as $column => $data): ?>
				<td><?php 
					if ($column == 'model_id'):
						$modeldata = ORM::factory('Model')->where('id', '=', $wallpaper->{$column})->find();
						echo $wallpaper->{$column} .' &mdash; '. $modeldata->producer . ' '. $modeldata->name . ' '. $modeldata->code;
					elseif ($column == 'modification_id'):
						$modificationdata = ORM::factory('Modification')->where('id', '=', $wallpaper->{$column})->find();
						echo $wallpaper->{$column} .' &mdash; '. $modificationdata->modification .'';
					else:
						echo Text::limit_chars(strip_tags($wallpaper->{$column}), 128, '...');
					endif;
				?></td>
			<?php endforeach; ?>
			<td><a href="<?php echo URL::site(Route::get('backend')->uri(array('controller' => 'wallpapers', 'action' => 'edit', 'par1' => $wallpaper->id))); ?>">ред.</a></td>
			<td><a href="<?php echo URL::site(Route::get('backend')->uri(array('controller' => 'wallpapers', 'action' => 'delete', 'par1' => $wallpaper->id))); ?>" onclick="return confirm('Подтверждаете удаление?');">удал.</a></td>
		</tr>
		<?php endforeach; ?>
	</tbody>
</table>